<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>

<c:if test="${not empty statusMessageKey}">
    <p><c:out value="${statusMessageKey}"/></p>
</c:if>

<c:if test="${not empty list}">
<ul>
<c:forEach var="user" items="${list}">
	<li><c:out value="${user.user}"/></li>
</c:forEach>
</ul>
</c:if>

<div>
<form:form action="/user/save" commandName="user">
    <fieldset style="display: table;">
        <div class="form-row" style="display: table-row;">
            <label for="name">User:</label>
            <span class="input"><form:input path="user" /></span>
        </div>
        <div class="form-row" style="display: table-row;">
            <label for="name">Password:</label>
            <span class="input"><form:password path="password" /></span>
        </div>
        <div class="form-row" style="display: table-row;">
            <label for="name">Name:</label>
            <span class="input"><form:input path="name" /></span>
        </div>
        <div class="form-row" style="display: table-row;">
            <label for="name">Surname:</label>
            <span class="input"><form:input path="surname" /></span>
        </div>
        <div class="form-row" style="display: table-row;">
            <label for="name">Address:</label>
            <span class="input"><form:input path="address" /></span>
        </div>
        <div class="form-row" style="display: table-row;">
            <label for="name">CP:</label>
            <span class="input"><form:input path="cp" /></span>
        </div>
        <div class="form-row" style="display: table-row;">
            <label for="name">Locality:</label>
            <span class="input"><form:input path="locality" /></span>
        </div>
        <div class="form-row" style="display: table-row;">
            <label for="name">Province:</label>
            <span class="input"><form:input path="province" /></span>
        </div>
        <div class="form-row" style="display: table-row;">
            <label for="name">Country:</label>
            <span class="input"><form:input path="country" /></span>
        </div>
       <div class="form-row" style="display: table-row;">
            <label for="name">Reference:</label>
            <span class="input">
            	<form:input path="references[0].name" /> - <form:input path="references[0].url" /> - <form:input path="references[0].note" /> 
           	</span>
        </div>
        <div class="form-row" style="display: table-row;">
            <label for="name">Favorite Bank Account:</label>
            <span class="input">
            	<form:input path="favoriteBankAccount[0].bank" /> - <form:input path="favoriteBankAccount[0].office" /> - <form:input path="favoriteBankAccount[0].dc" /> - <form:input path="favoriteBankAccount[0].number" /> <br/>
            	<form:input path="favoriteBankAccount[0].user"/>  
           	</span>
        </div>
        <div class="form-row" style="display: table-row;">
        	<label for="name">Role:</label>
        	<span class="input">
        		<form:select path="role">
        			<form:options items="${roles}" itemValue="key" itemLabel="value"/>
        		</form:select>
        	</span>
        </div>
        <div class="form-buttons">
            <div class="button"><input name="submit" type="submit" value="Guardar"/></div>
        </div>
    </fieldset>
</form:form>
</div>